import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import javax.swing.JPanel;

@SuppressWarnings("serial")
class GraphicComponent extends JPanel {
	BufferedImage[] images;

    public GraphicComponent(BufferedImage[] images) {
        this.images = images;
    }

    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        int w = getWidth();
        int h = getHeight();
        int iw = images[0].getWidth();
        int ih = images[0].getHeight();
        int overlap = iw/4;
        int x0 = (w - iw - (images.length-1)*overlap)/2;
        int y = (h - ih)/2;
        for(int i = 0; i < images.length; i++) {
            int x = x0 + i*overlap;
            g.drawImage(images[i], x, y, this);
        }
    }

    public Dimension getPreferredSize() {
        return new Dimension(75+(images.length*75/4),99);
    }
    
    public BufferedImage[] getImages() {
    	return images;
    }
}